# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Santiago Torres-Arias <santiago[at]archlinux[dot]org>
# Contributor: Aaron McDaniel (mcd1992) <'aur' at the domain 'fgthou.se'>

pkgname=iaito
_gitcommit=1c984ae94b128e9f9c526cc418956801cd035d6e
_transcommit=e66b3a962a7fc7dfd730764180011ecffbb206bf
pkgver=5.8.8
pkgrel=1
pkgdesc='Qt and C++ GUI for radare2 reverse engineering framework'
url='https://github.com/radareorg/iaito'
arch=('loong64' 'x86_64')
license=('GPL3')
depends=('radare2' 'capstone' 'qt5-base' 'qt5-svg' 'python'
         'pyside2' 'python-shiboken2' 'graphviz' 'gcc-libs')
makedepends=('git' 'shiboken2' 'qt5-tools')
optdepends=('r2ghidra: ghidra decompiler plugin')
replaces=('r2cutter')
source=("git+https://github.com/radareorg/iaito#commit=${_gitcommit}"
        "git+https://github.com/radareorg/iaito-translations#commit=${_transcommit}")
sha512sums=('SKIP'
            'SKIP')
b2sums=('SKIP'
        'SKIP')

pkgver() {
  cd iaito
  git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cp -r iaito-translations iaito/src/translations
}

build() {
  cd iaito
  ./configure --prefix=/usr
  mkdir build
  cd build
  qmake-qt5 ../src PREFIX=/usr
  make
}

package() {
  cd iaito
  make -C build INSTALL_ROOT="$pkgdir" install
  make DESTDIR="$pkgdir" PREFIX=/usr install-translations install-man
}

# vim: ts=2 sw=2 et:
